'''
	Contains a Cone geom.
	
	@author: J.H.Donker
	@copyright: Twente University
'''
import vtk
import wx

from wx.lib.pubsub import Publisher
from HeaDSETGeom import *

class HeaDSETCone(HeaDSETGeom):
	
	# default properties
	#DEFSIZE = {'length': 1.00, 'radius': 0.50, 'resolution': 50}
	
	#constructor
	def __init__(self, label = HeaDSETGeom.CONE):
		'''
			This geom is a cone. 
			
			@param label: The desired label. Defaults to HeaDSETGeom.CONE.
		'''	
		# create cone source
		cone = vtk.vtkConeSource()
		cone.SetHeight(self.DEFSIZE['length'])
		cone.SetRadius(self.DEFSIZE['radius'])
		cone.SetResolution(self.DEFSIZE['resolution'] * 4)
		
		# create poly mapper
		coneMapper = vtk.vtkPolyDataMapper()
		coneMapper.SetInput(cone.GetOutput())
		
		# creat actor
		actor = HeaDSETVTKActor()
		actor.SetMapper(coneMapper)
		actor.SetGeom(self)
		
		# call super constructor
		HeaDSETGeom.__init__(self, actor, label)
		
	def TypeCopy(self):
		'''
			Returns a new HeaDSETCone.
				
			@return: Fresh HeaDSETCone.
		'''
		return HeaDSETCone(self.GetLabel())
